import request from '/@/utils/request';

/**
 * 历史数据API接口集合
 * @method getStatistics 获取统计信息
 * @method getHistoryData 获取历史数据列表
 * @method deleteHistoryData 删除历史数据
 */
export function useHistoryDataApi() {
	return {
		getStatistics: (params?: object) => {
			return request({
				url: '/api/statistics/',
				method: 'get',
				params: params,
			});
		},
		getHistoryData: (params?: object) => {
			return request({
				url: '/api/history/',
				method: 'get',
				params: params,
			});
		},
		queryHistoryData: (params?: object) => {
			return request({
				url: '/api/history/query_history_data/',
				method: 'get',
				params: params,
			});
		},
		deleteHistoryData: (data: object) => {
			return request({
				url: '/api/history/delete/',
				method: 'post',
				data: data,
			});
		},
		// 获取部门用户列表（使用新的API端点，只需登录权限）
		getDeptUsers: () => {
			return request({
				url: '/api/system/user/dept_users/',
				method: 'get',
			});
		},
	};
}